package com.itheima.test;

import java.util.Random;
import java.util.Scanner;

public class test2 {
    public static void main(String[] args) {
        int arr[]={1,2,3,4,5,6,7,8,9,10};
        int[] copyOfRange = copyOfRange(arr, 0, 10);
        for (int i = 0; i < copyOfRange.length; i++) {
            System.out.print(copyOfRange[i]+" ");
        }



    }


        public static int[] copyOfRange(int arr[],int from,int to){
        int arr1[]=new int[to-from];
        int j=0;
        for(int i=from;i<to;i++){
                arr1[j]=arr[i];
                j++;
        }
       return arr1;
    }


}
